package com.gdpu.liou.symphonyserver.common.utils;

import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.HashMap;

/**
 * 自定义工具类
 * @author liuyx
 * @date 2022/5/19 13:50 周四
 */
public class LIUUtil {
    /**
     * 获取请求参数
     */
    public static HashMap<String, String> getParams(HttpServletRequest request) {
        HashMap<String, String> params = new HashMap<>(16);
        Enumeration<String> parameterNames = request.getParameterNames();
        while (parameterNames.hasMoreElements()) {
            String parameterName = parameterNames.nextElement();
            params.put(parameterName, request.getParameter(parameterName));
        }
        return params;
    }
}
